package ast;

import src.NFA;
import src.State;

public class AnyNode extends ASTNode {

	public AnyNode(){
		super();
		this.value = ".";
	}
	
	@Override
	public NFA generateNFA() {
		// Create a new start and end state
		State start = new State(false);
		State accepting = new State(true);

		// create a transition from all the printable character values to the end state
		for (char c = this.PRINTABLE_CHAR_START_VAL; c <= this.PRINTABLE_CHAR_END_VAL; ++c) {
			start.addTransition(c, accepting);
		}

		NFA nfa = new NFA(start,accepting); // Create a NFA
		
		return nfa;
	}

}
